<?php
App::uses('AppModel', 'Model');
/**
 * MobileModel Model
 *
 * @property MobileBase $MobileBase
 * @property ScreenType $ScreenType
 * @property ScreenStandard $ScreenStandard
 * @property ScreenResolution $ScreenResolution
 * @property ScreenSize $ScreenSize
 * @property Chipset $Chipset
 * @property Gpus $Gpus
 * @property CardSlotType $CardSlotType
 * @property BatteryType $BatteryType
 * @property Product $Product
 * @property PurchaseDetail $PurchaseDetail
 * @property SaleDetail $SaleDetail
 */
class MobileModel extends AppModel {

/**
 * Use database config
 *
 * @var string
 */
	public $useDbConfig = 'connection_local';

/**
 * Primary key field
 *
 * @var string
 */
	public $primaryKey = 'mobile_model_id';

/**
 * Display field
 *
 * @var string
 */
	public $displayField = 'mobile_name';

/**
 * Validation rules
 *
 * @var array
 */
	public $validate = array(
		'price' => array(
			'maxLength' => array(
				'rule' => array('maxLength', 10),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'naturalNumber' => array(
				'rule' => array('naturalNumber'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'discount' => array(
			'maxLength' => array(
				'rule' => array('maxLength', 10),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'warranty_month' => array(
			'maxLength' => array(
				'rule' => array('maxLength',8),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'naturalNumber' => array(
				'rule' => array('naturalNumber'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'mobile_name' => array(
			'maxLength' => array(
				'rule' => array('maxLength',20),
				//'message' => 'Your custom message here',
				'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'mobile_dimension' => array(
			'maxLength' => array(
				'rule' => array('maxLength',50),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'mobile_weight' => array(
			'maxLength' => array(
				'rule' => array('maxLength',5),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'numeric' => array(
				'rule' => array('numeric'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'screen_color_count' => array(
			'maxLength' => array(
				'rule' => array('maxLength',10),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'naturalNumber' => array(
				'rule' => array('naturalNumber'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'touch_description' => array(
			'maxLength' => array(
				'rule' => array('maxLength',500),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'camera_feature' => array(
			'maxLength' => array(
				'rule' => array('maxLength',500),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'cpu_speed' => array(
			'maxLength' => array(
				'rule' => array('maxLength',30),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'ram' => array(
			'maxLength' => array(
				'rule' => array('maxLength',20),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'naturalNumber' => array(
				'rule' => array('naturalNumber'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'internal_storage' => array(
			'maxLength' => array(
				'rule' => array('maxLength',20),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
            'naturalNumber' => array(
                'rule' => array('naturalNumber'),
                //'message' => 'Your custom message here',
                //'allowEmpty' => false,
                //'required' => false,
                //'last' => false, // Stop validation after this rule
                //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
		),
		'storage_up_to' => array(
			'maxLength' => array(
				'rule' => array('maxLength',20),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'naturalNumber' => array(
				'rule' => array('naturalNumber'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'battery_capacity' => array(
			'maxLength' => array(
				'rule' => array('maxLength',20),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'naturalNumber' => array(
				'rule' => array('naturalNumber'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'battery_removable' => array(
			'boolean' => array(
				'rule' => array('boolean'),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'sim_count' => array(
			'maxLength' => array(
				'rule' => array('maxLength', 2),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'naturalNumber' => array(
				'rule' => array('naturalNumber'),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'three_description' => array(
			'maxLength' => array(
				'rule' => array('maxLength',500),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'four_description' => array(
			'maxLength' => array(
				'rule' => array('maxLength'),500,
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'gps_description' => array(
			'maxLength' => array(
				'rule' => array('maxLength',500),
				//'message' => 'Your custom message here',
                'allowEmpty' => true,
                'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'bluetooth_description' => array(
			'maxLength' => array(
				'rule' => array('maxLength',500),
				//'message' => 'Your custom message here',
				'allowEmpty' => true,
				'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * belongsTo associations
 *
 * @var array
 */
	public $belongsTo = array(
		'MobileBase' => array(
			'className' => 'MobileBase',
			'foreignKey' => 'mobile_base_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'ScreenType' => array(
			'className' => 'ScreenType',
			'foreignKey' => 'screen_type_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'ScreenStandard' => array(
			'className' => 'ScreenStandard',
			'foreignKey' => 'screen_standard_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'ScreenResolution' => array(
			'className' => 'ScreenResolution',
			'foreignKey' => 'screen_resolution_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'ScreenSize' => array(
			'className' => 'ScreenSize',
			'foreignKey' => 'screen_size_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Chipset' => array(
			'className' => 'Chipset',
			'foreignKey' => 'chipset_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'Gpus' => array(
			'className' => 'Gpus',
			'foreignKey' => 'gpus_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'CardSlotType' => array(
			'className' => 'CardSlotType',
			'foreignKey' => 'card_slot_type_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		),
		'BatteryType' => array(
			'className' => 'BatteryType',
			'foreignKey' => 'battery_type_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

/**
 * hasMany associations
 *
 * @var array
 */
	public $hasMany = array(
		'Product' => array(
			'className' => 'Product',
			'foreignKey' => 'mobile_model_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
		'PurchaseDetail' => array(
			'className' => 'PurchaseDetail',
			'foreignKey' => 'mobile_model_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
		'SaleDetail' => array(
			'className' => 'SaleDetail',
			'foreignKey' => 'mobile_model_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);

}
